<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/8/3
 * Time: 13:06
 */

namespace app\admin\controller;


use app\model\DetailModel;
use app\model\OrderModel;
use app\model\WareModel;
use think\facade\View;

class Detail
{
    public function index()
    {
        $detailList = DetailModel::select();

        foreach ($detailList as &$row){
            $ware = WareModel::find($row['ware_id']);
            $row['ware_name'] = $ware['ware_name'];     //商品名称赋值给当前订单
            $row['ware_image'] = $ware['ware_image'];
            $row['ware_price'] = $ware['ware_price'];
            $row['ware_type'] = $ware['ware_type'];
        }
        unset($row);

        View::assign('detailList', $detailList);
        return View::fetch();
    }
}